<?php
defined("_ARKN_EXEC") or exit("no no, mr. superman no here");
($_SESSION["roleid"] == Roles::Secretary) or exit("you almost got away with it");
require ROOT_FOLDER . "/php/pages/menu_strip.php";
require_once ROOT_FOLDER . "/php/scripts/site_dep_scripts/Department.php";
require_once ROOT_FOLDER . "/php/scripts/course_scripts/Course.php";
$departments = $department->departments();
?>
<br />
<br />
<form method="post" action="<?php print(ROOT_ADDRESS . "?page=run_addcourse"); ?>" id="login_form">
	<fieldset>
		<legend>
			Add a new course
		</legend>
		<table>
			<tr>
				<td>Department:</td>
				<td>
				<?php
				print('<select name="departmentid">');
				foreach($departments as $row) {
					print('<option value="' . htmlEsc($row->id) . '">');
					print(htmlEsc($row->name));
					print("</option>");
				}
				print("</select>");
				?>
				</td>
			</tr>
			<tr>
				<td>Name:</td>
				<td>
				<input class="credential_input" type="text" name="coursename" id="coursename" />
				</td>
			</tr>
			<tr>
				<td>Credits:</td>
				<td>
				<input class="credential_input" type="text" name="credits" id="credits" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<input class="credential_submit_btn" type="submit" name="btnAddCourse" value="Add Course"/>
				</td>
			</tr>
		</table>
	</fieldset>
</form>
